fn main() {
    let sum = (0..1000).filter(|x| x % 3 == 0 || x % 5 == 0).sum::<i32>();
    println!(
        "the sum of all the multiples of 3 or 5 below  is {sum}|{}",
        problem1(1000)
    );
}

fn problem1(num: i32) -> i32 {
    let mut nums = vec![];
    for val in 1..num {
        if val % 3 == 0 || val % 5 == 0 {
            nums.push(val);
        }
    }
    nums.iter().sum::<i32>()
}
